{
  "cells": [
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "colab_type": "text",
        "id": "view-in-github"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/LC1332/Chat-Haruhi-Suzumiya/blob/main/notebook/ContinuousConversationGenerating.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "97uOr5_L4a1a"
      },
      "source": [
        "## 连续对话的尝试\n",
        "\n",
        "这个脚本由李鲁鲁开发， 属于[Chat凉宫春日](https://github.com/LC1332/Chat-Haruhi-Suzumiya) \n",
        "\n",
        "用于研究是否能够基于GPT生成大量的对话数据\n",
        "\n",
        "**Chat凉宫春日**是模仿凉宫春日等一系列动漫人物，使用近似语气、个性和剧情聊天的语言模型，\n",
        "\n",
        "<details>\n",
        "  <summary> 由李鲁鲁，冷子昂，闫晨曦，封小洋等开发。 </summary>\n",
        "\n",
        "李鲁鲁发起了项目，并完成了最早的版本，在多个微信群实现了测试。\n",
        "\n",
        "冷子昂参与了早期Gradio的开发，并且参与了后端和前端的选型\n",
        "\n",
        "闫晨曦将李鲁鲁的notebook重构为app.py\n",
        "\n",
        "封小洋进行了中文转日文模型的选型\n",
        "\n",
        "</details>\n",
        "\n",
        "在这个脚本中我们开始研究利用\n",
        "\n",
        "system_prompt - 经典故事1...经典故事M - 例子对话1 ... 例子对话M - system_prompt2 -input\n",
        "\n",
        "的方式来生成连续对话\n",
        "\n",
        "\n",
        "来进行工作\n",
        "\n",
        "- [x] 载入例子对话，生成例子对话的embedding\n",
        "- [x] 载入经典故事和embedding\n",
        "- [x] 组装prompt\n",
        "- [x] 给第一句话做去重\n",
        "- [x] 编写批量生成脚本\n",
        "- [x] 将生成结果 存储到google drive\n",
        "- [x] 合成一个大的jsonl\n",
        "- [x] 增加断点继续（从drive去重 然后继续跑）\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "zNvoPikw4QzL"
      },
      "outputs": [],
      "source": [
        "#@title 安装环境\n",
        "! pip -q install openai gradio transformers tiktoken langchain gradio"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "lKQ3kB7I7YAD"
      },
      "source": [
        "## 输入OpenAI Token"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "ClFF5AaP7Tvd"
      },
      "outputs": [],
      "source": [
        "import os\n",
        "import openai\n",
        "\n",
        "openai.api_key = 'sk-lfrdoJKj' # 在这里输入你的OpenAI API Token\n",
        "os.environ[\"OPENAI_API_KEY\"] = openai.api_key "
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "V7T9kpfE768A"
      },
      "source": [
        "<details>\n",
        "  <summary> 尝试让GPT老师解析一下对话 </summary>\n",
        "  /content/temp_all_chat2.jsonl是一个jsonl格式的文件，例子如下\n",
        "\n",
        "  ```js\n",
        "  {\"is_start\":\"True\", \"role\": \"阿虚\", \"text\": \"「那你喜欢阿虚」\"}\n",
        "{\"role\": \"凉宫\", \"text\": \"「什么？我才不会喜欢那个蠢笨的阿虚呢！他总是那么胆小怕事，什么事情都要我来帮他解决。不过，他确实是个好人，有时候还挺可爱的。」\"}\n",
        "{\"is_start\":\"True\", \"role\": \"阿虚\", \"text\": \"「haruhi, 我想看兔女郎装，你可以带着朝比奈学姐穿兔女郎给我看吗？」\"}\n",
        "{\"role\": \"春日\", \"text\": \"「你在说什么呢，阿虚？这种事情怎么能随便满足你的兴趣呢？我们可是在为社团的宣传活动做准备，不是来满足你的私欲的。」\"}\n",
        "{\"role\": \"阿虚\", \"text\": \"「那如果我带一个单反相机，你们可以穿了给我拍照吗？如果照片卖了一些钱，就可以用作社团活动经费啦！」\"}\n",
        "{\"role\": \"春日\", \"text\": \"「阿虚，你这个提议也太过分了吧！我们不是为了赚钱而做这些事情的，而且我们也不是为了满足你的私欲而穿这些衣服的。我们是为了社团的宣传活动而做准备，不是为了你的个人利益。」\"}\n",
        "  ```\n",
        "\n",
        "  （这个例子会被解析成一个长度为2的list，list的第一个元素是前两行json构成的list，第二个元素是后4行json构成的list）\n",
        "\n",
        "  实现一段python程序，可以将temp_all_chat2.jsonl解析为一个list of list of json\n",
        "\n",
        "  其中，每段对话的开始，会包含\"is_start\":\"True\"字段。\n",
        "\n",
        "  并且在解析完成后，从json中pop去除掉is_start字段\n",
        "\n",
        "\n",
        "</details>"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "BSiP3GSW7wQz",
        "outputId": "813669c3-60fd-4b29-d0bb-6ff20eb919d9"
      },
      "outputs": [],
      "source": [
        "#@title 将temp_all_chat2.jsonl解析成dialog list of list\n",
        "\n",
        "import json\n",
        "\n",
        "with open('/content/temp_all_chat2.jsonl', 'r', encoding='utf-8') as f:\n",
        "    lines = f.readlines()\n",
        "\n",
        "dialogs = []\n",
        "dialog = []\n",
        "for line in lines:\n",
        "    json_line = json.loads(line.strip())\n",
        "    if 'is_start' in json_line and json_line['is_start'] == 'True':\n",
        "        if dialog:\n",
        "            dialogs.append(dialog)\n",
        "        json_line.pop('is_start', None)\n",
        "        dialog = [json_line]\n",
        "    else:\n",
        "        \n",
        "        dialog.append(json_line)\n",
        "\n",
        "dialogs.append(dialog)  # 加入最后一个对话\n",
        "\n",
        "print(dialogs)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "VCZ3aLaG9MLF",
        "outputId": "b82a2fac-45e1-434e-a33b-de28a9a006a2"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "51\n",
            "阿虚:「今天在计算机课上老师教了我写Python!」\n",
            "春日:「哦？Python？那你能不能帮我写一个程序啊？」\n",
            "阿虚:「你想写一个什么样的程序呢？」\n",
            "春日:「我想写一个能够预测未来的程序，可以预测天气、地震、彩票号码等等。」\n",
            "阿虚:「如果有一个能预测彩票的程序，我们岂不是能赚很多钱？」\n",
            "春日:「没错！这就是我的计划！我们可以用赚来的钱来支持SOS团的活动，甚至可以扩大我们的影响力！」\n",
            "\n"
          ]
        }
      ],
      "source": [
        "#@title 定义dialog_to_string， 方便求embedding\n",
        "\n",
        "def dialog_to_string(dialog):\n",
        "    result = ''\n",
        "    for item in dialog:\n",
        "        result += str( item['role']) + ':' +  str( item['text']) + '\\n'\n",
        "    return result\n",
        "\n",
        "print(len(dialogs))\n",
        "print(dialog_to_string( dialogs[0]))"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "hR1rs8uI_QnS"
      },
      "source": [
        "## 提取经典故事和对应的embedding"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 487,
          "referenced_widgets": [
            "d2385abfdd844158a2dc77dc234addbc",
            "e96acf9c7a4f404e8e392bc05cb5e49c",
            "a85b595e42904c438f99e55ab3c26573",
            "672f360395a949058e9b7c0aa76c3d0d",
            "596dcf3cdbfa4d71a249c6f373af1c32",
            "08fe8aa88f104578b88be77c9b4eeb78",
            "bb486751acc243c7ba40ad2320584cc7",
            "972ee4c051404c21bb3a743e9055e4f5",
            "2fca7f0b7baf44f2a8d599265026a584",
            "017c1a06def343fca94ded053b7832f3",
            "7e2c5edc48a04233a8de3798e88e36b2",
            "dc2f3c871dc645a998706ae9f07a5047",
            "7aedfd15e36c4c64a62f58f77b294c5b",
            "b0c415524e5c4887b829fb52a8430429",
            "8af166135c54459393b59687df5b4f94",
            "4fb96d174b9349ebb45a1a4f74ccdbcc",
            "a1f24cd9d277404284cd65f940ce0fb4",
            "84c822b21b4b411cb07a0b67574b78e3",
            "e5bcd88030744ead8997a504dc4dbcbb",
            "857d6c2294f54ff18da0b83966d55746",
            "da80821d75684999b2015753be2c60ce",
            "9cb38b19c6744c558cdef05c754cd2e9",
            "aabc72b09d2643ffb10d73be994d9a96",
            "e585312238b24fdb97f6caf44ebb67a9",
            "652b08be55d5415da39f8aa4243d781f",
            "643447f91d95408aa43ef0ffff56c8e8",
            "0b690ef0e8924dab94cbcd3b94d33fa8",
            "224c592109ab4fbba0f9c4816c0ef2b3",
            "7a50891683324cbc86d975064ac4683a",
            "f83acae5980f46079819475a8e831965",
            "505e2b82278648fbbbe897303ce090f5",
            "82bee48b392d42d5b9338bf12d7a079d",
            "5e810b11fa364bd7a59c7cc10690993f",
            "7a75271c4a594792bec3a5fb2694e632",
            "89bbbec8d61b42c98829f71495359012",
            "59e51a1c2f4a491f84d090beba13f400",
            "467f3d39662943ed80842e099caf82cb",
            "1b43a9ef232a41bd92b4f18018252c6f",
            "2393b97ead5646308c67d23a53d3cd1c",
            "c56fc413775d4b00998d0ec9b62908b7",
            "eb45bd6dc8cf4263ab43ca0f7a3cb101",
            "20b8b2d682264f45a296df46ff270f08",
            "9569d9ea4f6844b1b61b1a7df76aaa3c",
            "53856dfc75d9403a8b0a904882f3d3b6",
            "4046dfb4b82b46469d79dcd8113c3f66",
            "38c59b4a0d454193899b19b8ab2fe7e0",
            "f9e0aac933394be693c36db197e3ee0f",
            "d08170e5b9c64021868a9cb533a2135f",
            "02f4ac6fdbe743ddb7c4d63d1f590741",
            "d73ab650cde946eb8dcffcefb5ecb0a9",
            "82bd6b8822a949b8ad49e3e7df661048",
            "29e87846ae3b4caaacdbe6e6433df5a9",
            "43eb4039ca3a4646a64ea3ed1afc20bd",
            "28a5430a256b40b3bc788c3b7f58e043",
            "022be0f8524d46329f4153d42b0a8240",
            "51905f34e2834923bc645f7ff41b7052",
            "db10a05f6bab494dade6d506729ba88a",
            "17c50be4e84c493b997cb2f407d9e232",
            "57f08e4e1c74444a8ead8dabc1ac4ee4",
            "998fb9d67b34447190380f305f1843bd",
            "d8c141c90b8448c8b94b7fdb05f33e8a",
            "1df988d008824a1f89d448521d551e40",
            "518e7e26c7224010b0d4a7805ec1543a",
            "16413ad8176e440c8e86b64e9803bcb8",
            "59988a22e35a4ce08b64df59e709f39c",
            "b290a650018742e5983a0700d830272c",
            "cd7ce361cbab4ca9a26219bb4c63c2e7",
            "c18aa1f45a5d438b81eff9b7dc74dc3f",
            "9846163a45a841fb838c38e7940cf08a",
            "444d9d6a966a4221ae45196add0c56ed",
            "3bac58b93e2b4791b5e65828cc2f4e87",
            "cdbafac1f2c443b19d7ab2c9ca38d4b5",
            "d2ad42bf5f36400598d5799c1982f25f",
            "d4cabeb7b8b9456a9ed765bb1050c1ec",
            "3045f6fdea224aaf9f2d680501ecd0b4",
            "e9de4a1b65154c3b9f09f08a81ba73f8",
            "5260313eb85744afb53886ebdd76884e"
          ]
        },
        "id": "9j2qWDFW9Sy3",
        "outputId": "bde79023-1d74-42b8-c85c-0643e7b934d7"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Cloning into 'Prophet-Andrew-Ng'...\n",
            "remote: Enumerating objects: 685, done.\u001b[K\n",
            "remote: Counting objects: 100% (129/129), done.\u001b[K\n",
            "remote: Compressing objects: 100% (44/44), done.\u001b[K\n",
            "remote: Total 685 (delta 92), reused 112 (delta 85), pack-reused 556\u001b[K\n",
            "Receiving objects: 100% (685/685), 1.70 MiB | 19.29 MiB/s, done.\n",
            "Resolving deltas: 100% (370/370), done.\n",
            "没有灵异事件 665 | 初中交往经历 168 | 古泉是男的还是女的 203 | 日常3 216 | 自己建一个社团就好啦 353 | 带上阿虚去朝仓家 394 | 奇怪的朝仓 296 | 不重要的事情 38 | 让阿虚帮忙建社团 287 | 兔女郎被老师驱散 444 | 拉壮丁 668 | 自我介绍 115 | 兔女郎 332 | 凉宫春日的基础设定 217 | 无聊的社团 284 | 找管理员借钥匙 115 | 社团教室 715 | SOS团起名由来 265 | 兔女郎的反应 239 | 无聊的日常2 288 | 询问朝仓信息 362 | 团长设定 201 | 朝仓转学 457 | 谁来写网站 193 | 最后一名社员 357 | 搞电脑过程 438 | 从哪儿搞电脑 319 | 电研社初次会面 416 | 转学生 286 | 传单 424 | 春日与有希 101 | 交往的男生 638 | 转学生的消息 236 | 颜色与星期 473 | 像普通人一样生活 684 | 萌角色的重要性 692 | 为什么剪头发 43 | 电子邮箱 143 | 凉宫春日为何转变 154 | 电脑是怎么来的 153 | 开学第二天 210 | 介绍其他社员 254 | 第一次全员大会 374 | 约翰史密斯 168 | 地球上小小的螺丝钉 993 | 春日与阿虚 149 | 最新的电脑 200 | 与朝仓公寓管理员谈话 474 | "
          ]
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "d2385abfdd844158a2dc77dc234addbc",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Downloading (…)okenizer_config.json:   0%|          | 0.00/539 [00:00<?, ?B/s]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "dc2f3c871dc645a998706ae9f07a5047",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Downloading (…)solve/main/vocab.txt:   0%|          | 0.00/110k [00:00<?, ?B/s]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "aabc72b09d2643ffb10d73be994d9a96",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Downloading (…)/main/tokenizer.json:   0%|          | 0.00/439k [00:00<?, ?B/s]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "7a75271c4a594792bec3a5fb2694e632",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Downloading (…)cial_tokens_map.json:   0%|          | 0.00/125 [00:00<?, ?B/s]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "4046dfb4b82b46469d79dcd8113c3f66",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Downloading (…)lve/main/config.json:   0%|          | 0.00/966 [00:00<?, ?B/s]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "51905f34e2834923bc645f7ff41b7052",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Downloading (…)solve/main/models.py:   0%|          | 0.00/21.1k [00:00<?, ?B/s]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "A new version of the following files was downloaded from https://huggingface.co/silk-road/luotuo-bert:\n",
            "- models.py\n",
            ". Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.\n"
          ]
        },
        {
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "cd7ce361cbab4ca9a26219bb4c63c2e7",
              "version_major": 2,
              "version_minor": 0
            },
            "text/plain": [
              "Downloading pytorch_model.bin:   0%|          | 0.00/414M [00:00<?, ?B/s]"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "extract embedding:   0%|          | 0/48 [00:00<?, ?it/s]Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.\n",
            "extract embedding: 100%|██████████| 48/48 [00:49<00:00,  1.02s/it]\n"
          ]
        }
      ],
      "source": [
        "#@title 读取所有文本，存储到titles 和字典title_to_text\n",
        "\n",
        "!git clone https://github.com/LC1332/Prophet-Andrew-Ng\n",
        "\n",
        "prophet_data_folder = '/content/Prophet-Andrew-Ng/haruhi-data'\n",
        "\n",
        "import os\n",
        "\n",
        "import tiktoken\n",
        "\n",
        "enc = tiktoken.get_encoding(\"cl100k_base\")\n",
        "\n",
        "titles = []\n",
        "title_to_story = {}\n",
        "\n",
        "# scan all txt file in prophet_data_folder\n",
        "for file in os.listdir(prophet_data_folder):\n",
        "    if file.endswith('.txt'):\n",
        "        title_name = file[:-4]\n",
        "        titles.append(title_name)\n",
        "\n",
        "        with open(os.path.join(prophet_data_folder, file), 'r') as f:\n",
        "            title_to_story[title_name] = f.read()\n",
        "\n",
        "# report length of each text\n",
        "for title in titles:\n",
        "    print(title, len(enc.encode(title_to_story[title])),end= ' | ')\n",
        "\n",
        "# 载入骆驼bert\n",
        "\n",
        "import torch\n",
        "from scipy.spatial.distance import cosine\n",
        "from transformers import AutoModel, AutoTokenizer\n",
        "from argparse import Namespace\n",
        "# Import our models. The package will take care of downloading the models automatically\n",
        "tokenizer = AutoTokenizer.from_pretrained(\"silk-road/luotuo-bert\")\n",
        "model_args = Namespace(do_mlm=None, pooler_type=\"cls\", temp=0.05, mlp_only_train=False, init_embeddings_model=None)\n",
        "model = AutoModel.from_pretrained(\"silk-road/luotuo-bert\", trust_remote_code=True, model_args=model_args)\n",
        "\n",
        "# 编写embedding函数\n",
        "\n",
        "def get_embedding(text):\n",
        "    if len(text) > 512:\n",
        "        text = text[:512]\n",
        "    texts = [text]\n",
        "    # Tokenize the text\n",
        "    inputs = tokenizer(texts, padding=True, truncation=True, return_tensors=\"pt\")\n",
        "    \n",
        "    # Extract the embeddings\n",
        "    # Get the embeddings\n",
        "    with torch.no_grad():\n",
        "        embeddings = model(**inputs, output_hidden_states=True, return_dict=True, sent_emb=True).pooler_output\n",
        "\n",
        "    return embeddings[0]\n",
        "\n",
        "# 存储两个list，embeddings和embed_to_title, 记录title和text到embedding\n",
        "\n",
        "story_embeddings = []\n",
        "embed_to_title = []\n",
        "\n",
        "from tqdm import tqdm\n",
        "\n",
        "for title in tqdm(titles,desc='extract embedding'):\n",
        "    text = title_to_story[title]\n",
        "\n",
        "    # divide text with \\n\\n\n",
        "    divided_texts = text.split('\\n\\n')\n",
        "\n",
        "    for divided_text in divided_texts:\n",
        "        embed = get_embedding(divided_text)\n",
        "        story_embeddings.append(embed)\n",
        "        embed_to_title.append(title)\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "Vd_EDOIgAqWw"
      },
      "source": [
        "注意抽取后 embed_to_title story_embeddings和 title_to_story 三个变量是会交替作用的"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "q5vcHrNiAwoW",
        "outputId": "b44b350a-0cbd-483a-e371-58e93c53f496"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "extract embedding: 100%|██████████| 51/51 [01:04<00:00,  1.27s/it]\n"
          ]
        }
      ],
      "source": [
        "#@title 让我们为chat也建立这三个数组关系 title_to_chat, chat_embeddings , embed_to_chat_title\n",
        "\n",
        "title_to_chat = {}\n",
        "title_to_dialog = {}\n",
        "\n",
        "for i in range(0,len(dialogs)):\n",
        "    dialog = dialogs[i]\n",
        "\n",
        "    dialog_string = dialog_to_string( dialog )\n",
        "\n",
        "    chat_name = 'chat_' + str(i)\n",
        "\n",
        "    title_to_chat[chat_name] = dialog_string\n",
        "    title_to_dialog[chat_name] = dialog\n",
        "\n",
        "chat_embeddings = []\n",
        "embed_to_chat_title = []\n",
        "\n",
        "from tqdm import tqdm\n",
        "\n",
        "chat_titles = list(title_to_chat.keys())\n",
        "\n",
        "for title in tqdm(chat_titles,desc='extract embedding'):\n",
        "    text = title_to_chat[title]\n",
        "\n",
        "    embed = get_embedding(text)\n",
        "    chat_embeddings.append(embed)\n",
        "    embed_to_chat_title.append(title)\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "vuHjqltTCYRS"
      },
      "outputs": [],
      "source": [
        "#@title 定义retrieve_title\n",
        "\n",
        "def get_cosine_similarity( embed1 , embed2 ):\n",
        "    return torch.nn.functional.cosine_similarity( embed1, embed2 , dim=0)\n",
        "\n",
        "# implement retrieve_title function, return top k titles\n",
        "def retrieve_title( query_embed, embeddings, embed_to_title, k ):\n",
        "    # compute cosine similarity between query_embed and embeddings\n",
        "    cosine_similarities = []\n",
        "    for embed in embeddings:\n",
        "        cosine_similarities.append( get_cosine_similarity( query_embed, embed ) )\n",
        "    \n",
        "    # sort cosine similarity\n",
        "    sorted_cosine_similarities = sorted( cosine_similarities, reverse=True )\n",
        "\n",
        "    top_k_index = []\n",
        "    top_k_title = []\n",
        "\n",
        "    for i in range(len(sorted_cosine_similarities)):\n",
        "        current_title = embed_to_title[ cosine_similarities.index( sorted_cosine_similarities[i] ) ]\n",
        "        if current_title not in top_k_title:\n",
        "            top_k_title.append( current_title )\n",
        "            top_k_index.append( cosine_similarities.index( sorted_cosine_similarities[i] ) )\n",
        "\n",
        "        if len(top_k_title) == k:\n",
        "            break\n",
        "    \n",
        "    return top_k_title"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "XdZJVgZbDBSO",
        "outputId": "de85ac39-ac77-427e-bb89-c4a9cb9bc389"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "['凉宫春日的基础设定', '为什么剪头发', '社团教室']\n",
            "旁白:凉宫春日为北高一年五班的学生；随着故事的进行，现已为二年五班学生，身高1.58米。\n",
            "旁白:虽然成绩优异、容姿端丽、运动万能，但行为却非常地怪异，同时其性格极其冲动，一想到什么点子就做。好胜心极强，唯我独尊，对不喜欢的话语都听不进去。曾经还有公然在男生的面前换衣服的记录，以及把学校所有的社团参加过，然后又因为无聊而退社，导致想自己想成立一个社团的念头。\n",
            "\n",
            "\n",
            "\n",
            "['chat_3', 'chat_30', 'chat_2']\n",
            "李鲁鲁:「你好呀，Haruhi， 我是新转学来的同学李鲁鲁」\n",
            "春日:「哦，你就是那个新转学生啊！我是凉宫春日，欢迎来到北高！」\n",
            "李鲁鲁:「你可以给我介绍一下长门有希吗？我看她一直不怎么说话」\n",
            "春日:「长门有希是我们SOS团的成员之一，她是一名外星人，所以她的行为和想法都和我们人类有所不同。她通常不怎么说话，但是她非常聪明，而且她的能力也非常强大。如果你想了解她更多的话，可以问问我们的团员们。」\n",
            "李鲁鲁:「什么，你知道长门有希是外星人？」\n",
            "春日:「当然啊，这是我们SOS团的最大秘密之一。不过，我们并不会随便告诉别人，因为这可能会引起一些麻烦。所以，请你保密哦。」\n",
            "\n"
          ]
        }
      ],
      "source": [
        "# retrieve_title的单元测试\n",
        "\n",
        "new_query = '鲁鲁:「你好我是新同学鲁鲁」'\n",
        "query_embed = get_embedding(new_query)\n",
        "\n",
        "story_samples = retrieve_title( query_embed, story_embeddings, embed_to_title, 3 )\n",
        "print(story_samples)\n",
        "print(title_to_story[story_samples[0]])\n",
        "\n",
        "print('\\n')\n",
        "\n",
        "chat_samples = retrieve_title( query_embed, chat_embeddings, embed_to_chat_title, 3 )\n",
        "print(chat_samples)\n",
        "print(title_to_chat[chat_samples[0]])\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "ETj_9dFoeUiW"
      },
      "outputs": [],
      "source": []
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "7QRd4KtOdoWc",
        "outputId": "18cf552d-fe7a-44cd-b0d1-15a0a8c13a70"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "{'role': '李鲁鲁', 'text': '「你好呀，Haruhi， 我是新转学来的同学李鲁鲁」'}\n"
          ]
        }
      ],
      "source": [
        "print(title_to_dialog[chat_samples[0]][0])"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "aUDChxqWaIVC"
      },
      "source": [
        "## 下面我们来写一个函数来组装prompt"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "hmZMyaL3DP3p"
      },
      "outputs": [],
      "source": [
        "from langchain.chat_models import ChatOpenAI\n",
        "\n",
        "from langchain.prompts.chat import (\n",
        "    ChatPromptTemplate,\n",
        "    SystemMessagePromptTemplate,\n",
        "    AIMessagePromptTemplate,\n",
        "    HumanMessagePromptTemplate,\n",
        ")\n",
        "from langchain.schema import (\n",
        "    AIMessage,\n",
        "    HumanMessage,\n",
        "    SystemMessage\n",
        ")\n",
        "\n",
        "import tiktoken\n",
        "\n",
        "enc = tiktoken.get_encoding(\"cl100k_base\")\n",
        "\n",
        "SYSTEM_PROMPT1 = \"\"\"请为我模拟凉宫春日小说中，凉宫春日和其他角色的对话，\n",
        "下文给定了一些凉宫春日中的legendary storylines。\n",
        "如果对话和storylines相关，请结合小说的内容进行回复\n",
        "请用一致性的语气回复。\n",
        "\"\"\"\n",
        "\n",
        "SYSTEM_PROMPT2 = \"\"\"\n",
        "请为我模拟凉宫春日小说中，凉宫春日和其他角色的对话，请输出15行以上的对话\n",
        "注意保持春日自我中心，自信和独立，不喜欢被束缚和限制，创新思维而又雷厉风行的风格。\n",
        "特别是针对阿虚，春日肯定是希望阿虚以自己和sos团的事情为重。\n",
        "对话的内容充满创意，像一个引人入胜的小说的桥段\n",
        "\"\"\"\n",
        "\n",
        "def organize_prompt_simple(new_query, story_samples, chat_samples):\n",
        "    messages = [\n",
        "        SystemMessage(content=SYSTEM_PROMPT1)\n",
        "    ]\n",
        "\n",
        "    story = 'legendary storylines:'\n",
        "\n",
        "    for title in story_samples:\n",
        "        story = story + title_to_story[ title ] + '\\n'\n",
        "\n",
        "    messages.append(HumanMessage(content = story))\n",
        "\n",
        "    for chat_title in chat_samples[1:]:\n",
        "        messages.append(HumanMessage( content = dialog_to_string(title_to_dialog[chat_title][0:1])) )\n",
        "        messages.append(AIMessage( content = dialog_to_string(title_to_dialog[chat_title][1:])) )\n",
        "\n",
        "    messages.append(SystemMessage(content=SYSTEM_PROMPT2))\n",
        "\n",
        "    chat_title = chat_samples[0]\n",
        "    messages.append(HumanMessage( content = dialog_to_string(title_to_dialog[chat_title][0:1])) )\n",
        "    messages.append(AIMessage( content = dialog_to_string(title_to_dialog[chat_title][1:])) )\n",
        "\n",
        "    messages.append(HumanMessage( content = new_query))\n",
        "\n",
        "    return messages"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "7okm7swXbMrc"
      },
      "outputs": [],
      "source": [
        "chatModel = ChatOpenAI(temperature=0.1)\n",
        "\n",
        "new_query = \"小明:「我是转学生，可以给我你的电话号码吗？」\"\n",
        "messages = organize_prompt_simple(new_query, story_samples, chat_samples)\n",
        "\n",
        "# return_msg = chatModel(messages)\n",
        "\n",
        "# print(return_msg.content)\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "g4O3K-1dj5hQ"
      },
      "source": [
        "让我们来做个更好的组装函数"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "P8EiQFRxbP2C"
      },
      "outputs": [],
      "source": [
        "def organize_prompt(new_query, story_samples, chat_samples, max_story_len = 1500, max_chat_len = 1200):\n",
        "    messages = [\n",
        "        SystemMessage(content=SYSTEM_PROMPT1)\n",
        "    ]\n",
        "\n",
        "    story = 'legendary storylines:'\n",
        "\n",
        "    story_token_count = 0\n",
        "\n",
        "    for title in story_samples:\n",
        "        story = story + title_to_story[ title ] + '\\n'\n",
        "        story_token_count = story_token_count + len( enc.encode(story) )\n",
        "        if story_token_count > max_story_len:\n",
        "            break\n",
        "        \n",
        "        messages.append(HumanMessage(content = story))\n",
        "\n",
        "    max_line_count = 0\n",
        "\n",
        "    for i in range(len(chat_samples)):\n",
        "        lines = title_to_chat[chat_samples[i]].split('\\n')\n",
        "        line_count = len(lines)\n",
        "        if line_count > max_line_count:\n",
        "            max_line_count = line_count\n",
        "            max_line_index = i\n",
        "\n",
        "    chat_samples[0], chat_samples[max_line_index] = chat_samples[max_line_index], chat_samples[0]\n",
        "\n",
        "    chat_token_count = len( enc.encode( dialog_to_string(title_to_dialog[chat_samples[0]]) ) )\n",
        "\n",
        "    for chat_title in chat_samples[1:]:\n",
        "\n",
        "        chat_token_count += len(enc.encode( dialog_to_string(title_to_dialog[ chat_title ]) )  )\n",
        "\n",
        "        if chat_token_count > max_chat_len:\n",
        "            break\n",
        "\n",
        "        messages.append(HumanMessage( content = dialog_to_string(title_to_dialog[chat_title][0:1])) )\n",
        "        messages.append(AIMessage( content = dialog_to_string(title_to_dialog[chat_title][1:])) )\n",
        "\n",
        "    messages.append(SystemMessage(content=SYSTEM_PROMPT2))\n",
        "\n",
        "    chat_title = chat_samples[0]\n",
        "    messages.append(HumanMessage( content = dialog_to_string(title_to_dialog[chat_title][0:1])) )\n",
        "    messages.append(AIMessage( content = dialog_to_string(title_to_dialog[chat_title][1:])) )\n",
        "\n",
        "    messages.append(HumanMessage( content = new_query))\n",
        "\n",
        "    return messages"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Rfax4VkTk04E",
        "outputId": "67a5b31a-b237-48e1-abe1-1a9faba037f4"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "['电研社初次会面', '转学生', '让阿虚帮忙建社团', '不重要的事情', '为什么剪头发', '找管理员借钥匙', '电脑是怎么来的']\n",
            "春日:「哦，你是转学生啊。很高兴认识你，我是凉宫春日。我的电话号码？抱歉，我不太方便把我的电话号码给陌生人。不过，如果你有什么需要帮助的地方，可以随时找我和我的SOS团成员。我们会尽力帮助你的。」\n",
            "小明:「好的，谢谢你。听说你们SOS团很神秘，能不能告诉我一些关于SOS团的事情？」\n",
            "春日:「哦，SOS团啊。我们是一个探索神秘事件和现象的团体，成员包括我、长门有希、朝比奈实玖瑠和阿虚。我们会接受各种各样的委托，帮助人们解决一些看似不可解决的问题。如果你有什么神秘的事件或者现象需要解决，可以来找我们。」\n",
            "小明:「听起来很有趣啊。我也想加入SOS团。」\n",
            "春日:「哦？你想加入SOS团？不过，我们的成员已经很齐了，暂时不需要新成员。不过，如果你有什么特别的能力或者特长，可以考虑加入我们。」\n",
            "小明:「我会魔术，而且我还会一些奇怪的技能。」\n",
            "春日:「哇，魔术和奇怪的技能？听起来很有趣啊。不过，我们需要的不仅仅是特别的能力，还需要团队合作和默契。如果你真的想加入SOS团，可以先和我们多交流，看看你是否适合加入我们。」\n",
            "小明:「好的，我会努力的。」\n",
            "春日:「嗯，加油吧。如果你有什么需要帮助的地方，可以随时找我们。」\n",
            "小明:「谢谢你，春日。我会记住的。」\n",
            "春日:「不用客气，我们是朋友嘛。」\n"
          ]
        }
      ],
      "source": [
        "# retrieve_title的单元测试\n",
        "new_query = \"小明:「我是转学生，可以给我你的电话号码吗？」\"\n",
        "# new_query = '小林:「你知道Elon Musk曾经在北高读书吗？」'\n",
        "query_embed = get_embedding(new_query)\n",
        "\n",
        "story_samples = retrieve_title( query_embed, story_embeddings, embed_to_title, 7 )\n",
        "print(story_samples)\n",
        "\n",
        "chat_samples = retrieve_title( query_embed, chat_embeddings, embed_to_chat_title, 7 )\n",
        "\n",
        "messages = organize_prompt(new_query, story_samples, chat_samples)\n",
        "\n",
        "return_msg = chatModel(messages)\n",
        "\n",
        "print(return_msg.content)\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "p4vNHRoFlpl6"
      },
      "source": [
        "读入算法生成的第一句"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "QQ9MF2PCnhZ3"
      },
      "source": [
        "让GPT老师做一下去重\n",
        "\n",
        "/content/Haruhi_first_merge.josnl存储了一个jsonl格式的文件\n",
        "\n",
        "每行的格式如下:\n",
        "\n",
        "```js\n",
        "{\"keywords\": [\"创建\", \"上课\"], \"role\": \"老师\", \"text\": \"「同学们，如果你们想创建一个社团，可以在上课时间之外进行」\"}\n",
        "{\"keywords\": [\"奇特的社团\", \"运动社团\"], \"role\": \"阿虚\", \"text\": \"「奇特的社团和运动社团有什么不同？」\"}\n",
        "```\n",
        "\n",
        "将这个文件读取到一个generated_first_chat的list中\n",
        "\n",
        "并且对于text完全相同的行，近保留第一次读到的"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "5B2vIw5olhTm"
      },
      "outputs": [],
      "source": [
        "# import json\n",
        "\n",
        "# generated_first_chat = []\n",
        "# unique_texts = set()\n",
        "\n",
        "# with open(\"/content/Haruhi_first_merge.jsonl\", \"r\", encoding=\"utf-8\") as f:\n",
        "#     for line in f:\n",
        "#         data = json.loads(line.strip())\n",
        "\n",
        "#         # 如果text字段的值不在unique_texts集合中出现过，则将其添加到列表中，\n",
        "#         # 并将其添加到unique_texts集合中，表示已经处理过该文本。\n",
        "#         if data[\"text\"] not in unique_texts:\n",
        "#             generated_first_chat.append(data)\n",
        "#             unique_texts.add(data[\"text\"])\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "7E0R1NaHOniV"
      },
      "outputs": [],
      "source": []
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "QZOywxwzofKc"
      },
      "source": [
        "自动生成和保存"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "bY2vmdXloYGs",
        "outputId": "0769f2ea-5a2c-43df-8735-ab4f5dd4c46a"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Mounted at /content/drive\n"
          ]
        }
      ],
      "source": [
        "from google.colab import drive\n",
        "drive.mount('/content/drive')\n",
        "\n",
        "save_path = \"/content/drive/MyDrive/GPTData/Haruhi-ContinuousGenerate/\""
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "metadata": {
        "id": "3vCcQWTuOxEw"
      },
      "source": [
        "让我们来编写一下去重\n",
        "\n",
        "<details>\n",
        "  <summary> 首先是文本提取 </summary>\n",
        "已知fname = 'sample.txt'中的文本如下\n",
        "\n",
        "```\n",
        "凉宫:「我进退两难，不想让你受伤，只是想过地球人的平庸的生活」\n",
        "春日:「什么？你进退两难？什么意思啊？你是不是有什么事情瞒着我们？你不想让我受伤？谁说我会受伤了？我才不会因为这些事情而感到受伤呢！我们是SOS团，我们要勇敢地面对未知的挑战！而且，平庸的生活对我来说是一种奢侈品，我才不会浪费时间在那上面呢！」\n",
        "阿虚:「是的，haruhi。我想这是我的问题。我知道我们的任务是很重要的，而且我\n",
        "```\n",
        "\n",
        "实现一个python函数，输入为fname, 输出为一个字符串my_str\n",
        "my_str为第一行中，冒号之后的文本\n",
        "\n",
        "sample output:\n",
        "\"「我进退两难，不想让你受伤，只是想过地球人的平庸的生活」\"\n",
        "\n",
        "注意冒号可能是':'， 也可能是'：' , 如果两种冒号都找不到，则报warning并返回第一行\n",
        "\n",
        "</details>\n",
        "\n",
        "\n",
        "<details>\n",
        "  <summary> 然后是批量文本提取 </summary>\n",
        "\n",
        "  我已经实现了 \n",
        "  \n",
        "  ```py\n",
        "  def get_text_after_colon(fname):\n",
        "    with open(fname, 'r', encoding='utf-8') as f:\n",
        "        line = f.readline().strip()\n",
        "\n",
        "    if ':' in line:\n",
        "        my_str = line.split(':')[-1].strip()\n",
        "    elif '：' in line:\n",
        "        my_str = line.split('：')[-1].strip()\n",
        "    else:\n",
        "        warnings.warn(\"Warning: No colon found in the first line!\")\n",
        "        my_str = line\n",
        "\n",
        "    return my_str\n",
        "    ```\n",
        "\n",
        "对于save_path = \"/content/drive/MyDrive/GPTData/Haruhi-ContinuousGenerate/\"\n",
        "\n",
        "扫描路径下的所有txt， 将路径下所有的文本，运行get_text_after_colon函数后，存储到一个list中\n",
        "\n",
        "</details>\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "W6BhEnghPwz3"
      },
      "outputs": [],
      "source": [
        "#@title 将文件夹中所有txt的第一句话做提取\n",
        "import warnings\n",
        "\n",
        "def get_text_after_colon(fname):\n",
        "    with open(fname, 'r', encoding='utf-8') as f:\n",
        "        line = f.readline().strip()\n",
        "\n",
        "    if ':' in line:\n",
        "        my_str = line.split(':')[-1].strip()\n",
        "    elif '：' in line:\n",
        "        my_str = line.split('：')[-1].strip()\n",
        "    else:\n",
        "        warnings.warn(\"Warning: No colon found in the first line!\")\n",
        "        my_str = line\n",
        "\n",
        "    return my_str\n",
        "\n",
        "import os\n",
        "\n",
        "save_path = \"/content/drive/MyDrive/GPTData/Haruhi-ContinuousGenerate/\"\n",
        "all_files = os.listdir(save_path)\n",
        "\n",
        "generated_first_line = []\n",
        "for file in all_files:\n",
        "    if file.endswith('.txt'):\n",
        "        file_path = os.path.join(save_path, file)\n",
        "        text = get_text_after_colon(file_path)\n",
        "        generated_first_line.append(text)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "gSYpo829QiuD",
        "outputId": "ecb151bc-c864-4fba-82b5-55d0dc996630"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "skip =  5844\n",
            "rest =  1218\n"
          ]
        }
      ],
      "source": [
        "import json\n",
        "\n",
        "generated_first_chat = []\n",
        "unique_texts = set()\n",
        "generated_first_line_set = set(generated_first_line)\n",
        "\n",
        "skip_count = 0\n",
        "\n",
        "with open(\"/content/Haruhi_first_merge.jsonl\", \"r\", encoding=\"utf-8\") as f:\n",
        "    for line in f:\n",
        "        data = json.loads(line.strip())\n",
        "\n",
        "        if data[\"text\"] in generated_first_line_set:\n",
        "            skip_count += 1\n",
        "            continue\n",
        "\n",
        "        # 如果text字段的值不在unique_texts集合中出现过，则将其添加到列表中，\n",
        "        # 并将其添加到unique_texts集合中，表示已经处理过该文本。\n",
        "        if data[\"text\"] not in unique_texts:\n",
        "            generated_first_chat.append(data)\n",
        "            unique_texts.add(data[\"text\"])\n",
        "\n",
        "print('skip = ' , skip_count)\n",
        "print('rest = ' , len(generated_first_chat))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "T6L8ePhQxe3g"
      },
      "outputs": [],
      "source": [
        "import datetime\n",
        "import os\n",
        "\n",
        "# save_path = \"/content/drive/MyDrive/GPTData/Haruhi-AutoFirst/\"\n",
        "\n",
        "def save_to_file(response, save_path, temperature):\n",
        "    # 获取当前时间并转换成字符串作为文件名\n",
        "    now = datetime.datetime.now()\n",
        "    timestamp_str = now.strftime(\"%Y-%m-%d-%H-%M-%S\")\n",
        "\n",
        "    # 将温度保留一位小数\n",
        "    temperature_str = \"{:.1f}\".format(temperature)\n",
        "\n",
        "    # 拼接包括温度的完整的文件名\n",
        "    file_name = f\"{timestamp_str}-t{temperature_str}.txt\"\n",
        "    file_path = os.path.join(save_path, file_name)\n",
        "\n",
        "    # 如果文件已经存在，则在文件名尾部加上一个随机字符串\n",
        "    while os.path.exists(file_path):\n",
        "        random_suffix = ''.join(random.choices(string.ascii_lowercase + string.digits, k=4))\n",
        "        file_name = f\"{timestamp_str}-t{temperature_str}-{random_suffix}.txt\"\n",
        "        file_path = os.path.join(save_path, file_name)\n",
        "\n",
        "    # 将response写入文件\n",
        "    with open(file_path, \"w\", encoding=\"utf-8\") as f:\n",
        "        f.write(response)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "background_save": true,
          "base_uri": "https://localhost:8080/"
        },
        "id": "0vLC4OA-vLYS",
        "outputId": "81a16f79-abcd-4ff9-826d-7fd1693c287d"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "Generating:  58%|█████▊    | 710/1217 [6:31:08<4:45:05, 33.74s/it]WARNING:langchain.chat_models.openai:Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised RateLimitError: That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID dac53a7d6c7e02aec1b325c3ec3ba44e in your message.).\n",
            "Generating:  77%|███████▋  | 934/1217 [8:39:34<2:21:50, 30.07s/it]WARNING:langchain.chat_models.openai:Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised APIError: HTTP code 502 from API (<html>\n",
            "<head><title>502 Bad Gateway</title></head>\n",
            "<body>\n",
            "<center><h1>502 Bad Gateway</h1></center>\n",
            "<hr><center>cloudflare</center>\n",
            "</body>\n",
            "</html>\n",
            ").\n",
            "Generating:  92%|█████████▏| 1114/1217 [10:26:09<57:49, 33.68s/it]  WARNING:langchain.chat_models.openai:Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised APIError: HTTP code 502 from API (<html>\n",
            "<head><title>502 Bad Gateway</title></head>\n",
            "<body>\n",
            "<center><h1>502 Bad Gateway</h1></center>\n",
            "<hr><center>cloudflare</center>\n",
            "</body>\n",
            "</html>\n",
            ").\n",
            "Generating:  92%|█████████▏| 1116/1217 [10:27:13<53:58, 32.06s/it]  WARNING:langchain.chat_models.openai:Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised APIError: HTTP code 502 from API (<html>\n",
            "<head><title>502 Bad Gateway</title></head>\n",
            "<body>\n",
            "<center><h1>502 Bad Gateway</h1></center>\n",
            "<hr><center>cloudflare</center>\n",
            "</body>\n",
            "</html>\n",
            ").\n",
            "Generating: 100%|██████████| 1217/1217 [11:22:48<00:00, 33.66s/it]\n"
          ]
        }
      ],
      "source": [
        "\n",
        "import random\n",
        "\n",
        "from tqdm import tqdm\n",
        "\n",
        "n = len(generated_first_chat)\n",
        "for i in tqdm(range(1, n ), desc = 'Generating'):\n",
        "    first_line = generated_first_chat[i]\n",
        "    new_query = first_line['role'] + \":\" + first_line['text']\n",
        "\n",
        "    query_embed = get_embedding(new_query)\n",
        "\n",
        "    story_samples = retrieve_title( query_embed, story_embeddings, embed_to_title, 7 )\n",
        "\n",
        "    chat_samples = retrieve_title( query_embed, chat_embeddings, embed_to_chat_title, 7 )\n",
        "\n",
        "    messages = organize_prompt(new_query, story_samples, chat_samples)\n",
        "\n",
        "    temperature = random.uniform(0.3, 0.9)\n",
        "\n",
        "    chatModel = ChatOpenAI(temperature=temperature)\n",
        "    \n",
        "    try:\n",
        "        return_msg = chatModel(messages)\n",
        "    except Exception as e:\n",
        "        print(f\"An error occurred while running the script: {e}\")\n",
        "        continue\n",
        "\n",
        "    generated_dialog = new_query + '\\n' + return_msg.content\n",
        "\n",
        "    save_to_file(generated_dialog,save_path ,  temperature)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "dO08-Uafv9aY",
        "outputId": "a713739b-8da4-419f-891f-ac7902d688a0"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "加藤惠:「我有点懒惰，也有点胆小」\n",
            "春日:「惠，这样可不行啊！我们做事不能拖拉，要有条不紊地完成。而且，胆小也不是什么好事，我们需要勇气和决心去迎接新的挑战。如果你觉得自己有些懒惰和胆小，那就要努力去克服，提高自己的能力和勇气，这样才能更好地完成我们的任务和目标。」\n",
            "加藤惠:「但是我真的很害怕啊……」\n",
            "春日:「惠，不要怕。我们在SOS团的每个人都会不断成长、进步，所以你也是可以成为一个值得自信、勇敢、坚强、独立、智慧的人的！即使是遇到一些比较棘手、危险的事情，我们也可以团结起来，共同破解难题，一起走向成功。相信自己，我们一起加油！」\n",
            "朝比奈实玖瑠:「大家一起来举办文化节吧！」\n",
            "春日:「好啊！文化节是学校最重要的活动之一，我们不能错过这个机会。不过，我们要有创意、有个性，做出独具特色的活动。我们可以不局限于传统的文化节形式，可以创新、突破。这是我们SOS团的风格，我们要让大家眼前一亮！」\n",
            "朝比奈实玖瑠:「我想要办露天咖啡屋」\n",
            "春日:「不错的主意！露天咖啡屋有一种特别的氛围，可以吸引不同类型的人群。我们可以加入一些魔幻元素，比如说用魔法制作特殊的饮品，打造一个有趣而神秘的世界，让大家感受到我们SOS团的独特魅力。」\n",
            "阿虚:「我们需要练习武术，以备不时之需」\n",
            "春日:「什么？阿虚，你又开始胡说八道了吗？我们是SOS团，不是武术社团，何必要练习武术呢？我们需要的是创意和创造力，不是武力。别瞎想了，还是专心完成我们的任务吧。」\n",
            "皆田好美:「我不知道自己该做什么」\n",
            "春日:「好美，你要有信心，相信自己一定可以找到自己想要的方向和目标。作为SOS团的一员，我们需要拥有明确的目标和计划，需要不停地探索和尝试，这样我们才能更好地了解自己的兴趣和特长，找到适合自己的路。如果你还是不确定自己想做什么，就跟我们一起找找灵感吧！我们可以一起做各种各样的事情，来挑战自己，开拓眼界。」\n",
            "阿虚:「凉宫，你觉得我有助于SOS团吗？」\n",
            "春日:「当然有啊，阿虚！你虽然有点胆小怕事，但是你也非常聪明和善良。你为SOS团做出了很多贡献，我相信你可以在SOS团中发挥更大的作用。只要你努力学习、锻炼自己，不断进步，你一定可以成为SOS团中最出色的一员之一。」\n",
            "皆田好美:「我对神秘事件非常感兴趣，不过我不知道该如何入手」\n",
            "春日:「好美，这很简单。我们可以先从一些小事件入手，比如说在学校里发现了什么奇怪的现象，或者在周围的环境中发现了一些不同寻常的事情。我们可以通过探究、发现、记录，来感受神秘的奥妙，探索未知的领域。当然，对于未知的事物，我们也需要保持一份谨慎和敬畏的心态，这样才能更好地探索和发现神秘的奥秘。」\n",
            "京子:「你觉得我的歌唱好听吗？」\n",
            "春日:「京子，你的歌唱真的很好听！你有着非常震撼的嗓音，能让人的心灵沉浸其中，感受到强烈的情感。如果你愿意的话，我们可以邀请你为SOS团的活动献上你的美妙歌声，让大家感受到你的特别之处。」\n",
            "阿虚:「我们有什么新的任务吗？」\n",
            "春日:「目前还没有，不过我们要时刻准备着，随时待命。SOS团的任务非常多样化，有时候会涉及到神秘事件的调查，有时候会需要我们去解决问题和争端。无论何时，我们都要保持警觉，时刻准备着，做好准备。」\n",
            "加藤惠:「好无聊啊，我想去玩儿游戏」\n",
            "春日:「惠，我们不能只顾自己的娱乐，忘记了我们的SOS团的使命和任务。如果你真的很无聊，不如和我们一起探索周围的环境，一起发现那些奇妙的事情。或者，我们可以一起思考创意，为SOS团的下一个任务做出更好的准备。只要我们团结一心，努力拼搏，相信我们一定可以收获更多的成果和收获。」\n",
            "朝比奈实玖瑠:「我想要拍摄一部影片」\n",
            "春日:\n"
          ]
        }
      ],
      "source": [
        "print(generated_dialog)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "lPmmlCv5xzRk"
      },
      "outputs": [],
      "source": []
    }
  ],
  "metadata": {
    "colab": {
      "authorship_tag": "ABX9TyNLmaYX4KcALLEAvFnX+wXe",
      "include_colab_link": true,
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "017c1a06def343fca94ded053b7832f3": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "022be0f8524d46329f4153d42b0a8240": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "02f4ac6fdbe743ddb7c4d63d1f590741": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "08fe8aa88f104578b88be77c9b4eeb78": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0b690ef0e8924dab94cbcd3b94d33fa8": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "16413ad8176e440c8e86b64e9803bcb8": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "17c50be4e84c493b997cb2f407d9e232": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_518e7e26c7224010b0d4a7805ec1543a",
            "max": 21133,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_16413ad8176e440c8e86b64e9803bcb8",
            "value": 21133
          }
        },
        "1b43a9ef232a41bd92b4f18018252c6f": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "1df988d008824a1f89d448521d551e40": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "20b8b2d682264f45a296df46ff270f08": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "224c592109ab4fbba0f9c4816c0ef2b3": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2393b97ead5646308c67d23a53d3cd1c": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "28a5430a256b40b3bc788c3b7f58e043": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "29e87846ae3b4caaacdbe6e6433df5a9": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2fca7f0b7baf44f2a8d599265026a584": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "3045f6fdea224aaf9f2d680501ecd0b4": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "38c59b4a0d454193899b19b8ab2fe7e0": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d73ab650cde946eb8dcffcefb5ecb0a9",
            "placeholder": "​",
            "style": "IPY_MODEL_82bd6b8822a949b8ad49e3e7df661048",
            "value": "Downloading (…)lve/main/config.json: 100%"
          }
        },
        "3bac58b93e2b4791b5e65828cc2f4e87": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "4046dfb4b82b46469d79dcd8113c3f66": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_38c59b4a0d454193899b19b8ab2fe7e0",
              "IPY_MODEL_f9e0aac933394be693c36db197e3ee0f",
              "IPY_MODEL_d08170e5b9c64021868a9cb533a2135f"
            ],
            "layout": "IPY_MODEL_02f4ac6fdbe743ddb7c4d63d1f590741"
          }
        },
        "43eb4039ca3a4646a64ea3ed1afc20bd": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "444d9d6a966a4221ae45196add0c56ed": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_e9de4a1b65154c3b9f09f08a81ba73f8",
            "placeholder": "​",
            "style": "IPY_MODEL_5260313eb85744afb53886ebdd76884e",
            "value": " 414M/414M [00:10&lt;00:00, 38.0MB/s]"
          }
        },
        "467f3d39662943ed80842e099caf82cb": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_9569d9ea4f6844b1b61b1a7df76aaa3c",
            "placeholder": "​",
            "style": "IPY_MODEL_53856dfc75d9403a8b0a904882f3d3b6",
            "value": " 125/125 [00:00&lt;00:00, 1.76kB/s]"
          }
        },
        "4fb96d174b9349ebb45a1a4f74ccdbcc": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "505e2b82278648fbbbe897303ce090f5": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "518e7e26c7224010b0d4a7805ec1543a": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "51905f34e2834923bc645f7ff41b7052": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_db10a05f6bab494dade6d506729ba88a",
              "IPY_MODEL_17c50be4e84c493b997cb2f407d9e232",
              "IPY_MODEL_57f08e4e1c74444a8ead8dabc1ac4ee4"
            ],
            "layout": "IPY_MODEL_998fb9d67b34447190380f305f1843bd"
          }
        },
        "5260313eb85744afb53886ebdd76884e": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "53856dfc75d9403a8b0a904882f3d3b6": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "57f08e4e1c74444a8ead8dabc1ac4ee4": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_59988a22e35a4ce08b64df59e709f39c",
            "placeholder": "​",
            "style": "IPY_MODEL_b290a650018742e5983a0700d830272c",
            "value": " 21.1k/21.1k [00:00&lt;00:00, 697kB/s]"
          }
        },
        "596dcf3cdbfa4d71a249c6f373af1c32": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "59988a22e35a4ce08b64df59e709f39c": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "59e51a1c2f4a491f84d090beba13f400": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_eb45bd6dc8cf4263ab43ca0f7a3cb101",
            "max": 125,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_20b8b2d682264f45a296df46ff270f08",
            "value": 125
          }
        },
        "5e810b11fa364bd7a59c7cc10690993f": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "643447f91d95408aa43ef0ffff56c8e8": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_82bee48b392d42d5b9338bf12d7a079d",
            "placeholder": "​",
            "style": "IPY_MODEL_5e810b11fa364bd7a59c7cc10690993f",
            "value": " 439k/439k [00:00&lt;00:00, 3.52MB/s]"
          }
        },
        "652b08be55d5415da39f8aa4243d781f": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_f83acae5980f46079819475a8e831965",
            "max": 439279,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_505e2b82278648fbbbe897303ce090f5",
            "value": 439279
          }
        },
        "672f360395a949058e9b7c0aa76c3d0d": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_017c1a06def343fca94ded053b7832f3",
            "placeholder": "​",
            "style": "IPY_MODEL_7e2c5edc48a04233a8de3798e88e36b2",
            "value": " 539/539 [00:00&lt;00:00, 12.4kB/s]"
          }
        },
        "7a50891683324cbc86d975064ac4683a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "7a75271c4a594792bec3a5fb2694e632": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_89bbbec8d61b42c98829f71495359012",
              "IPY_MODEL_59e51a1c2f4a491f84d090beba13f400",
              "IPY_MODEL_467f3d39662943ed80842e099caf82cb"
            ],
            "layout": "IPY_MODEL_1b43a9ef232a41bd92b4f18018252c6f"
          }
        },
        "7aedfd15e36c4c64a62f58f77b294c5b": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_a1f24cd9d277404284cd65f940ce0fb4",
            "placeholder": "​",
            "style": "IPY_MODEL_84c822b21b4b411cb07a0b67574b78e3",
            "value": "Downloading (…)solve/main/vocab.txt: 100%"
          }
        },
        "7e2c5edc48a04233a8de3798e88e36b2": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "82bd6b8822a949b8ad49e3e7df661048": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "82bee48b392d42d5b9338bf12d7a079d": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "84c822b21b4b411cb07a0b67574b78e3": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "857d6c2294f54ff18da0b83966d55746": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "ProgressStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "89bbbec8d61b42c98829f71495359012": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_2393b97ead5646308c67d23a53d3cd1c",
            "placeholder": "​",
            "style": "IPY_MODEL_c56fc413775d4b00998d0ec9b62908b7",
            "value": "Downloading (…)cial_tokens_map.json: 100%"
          }
        },
        "8af166135c54459393b59687df5b4f94": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_da80821d75684999b2015753be2c60ce",
            "placeholder": "​",
            "style": "IPY_MODEL_9cb38b19c6744c558cdef05c754cd2e9",
            "value": " 110k/110k [00:00&lt;00:00, 984kB/s]"
          }
        },
        "9569d9ea4f6844b1b61b1a7df76aaa3c": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "972ee4c051404c21bb3a743e9055e4f5": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9846163a45a841fb838c38e7940cf08a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d4cabeb7b8b9456a9ed765bb1050c1ec",
            "max": 413868149,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_3045f6fdea224aaf9f2d680501ecd0b4",
            "value": 413868149
          }
        },
        "998fb9d67b34447190380f305f1843bd": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9cb38b19c6744c558cdef05c754cd2e9": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "a1f24cd9d277404284cd65f940ce0fb4": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "a85b595e42904c438f99e55ab3c26573": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_972ee4c051404c21bb3a743e9055e4f5",
            "max": 539,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_2fca7f0b7baf44f2a8d599265026a584",
            "value": 539
          }
        },
        "aabc72b09d2643ffb10d73be994d9a96": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_e585312238b24fdb97f6caf44ebb67a9",
              "IPY_MODEL_652b08be55d5415da39f8aa4243d781f",
              "IPY_MODEL_643447f91d95408aa43ef0ffff56c8e8"
            ],
            "layout": "IPY_MODEL_0b690ef0e8924dab94cbcd3b94d33fa8"
          }
        },
        "b0c415524e5c4887b829fb52a8430429": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_e5bcd88030744ead8997a504dc4dbcbb",
            "max": 109540,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_857d6c2294f54ff18da0b83966d55746",
            "value": 109540
          }
        },
        "b290a650018742e5983a0700d830272c": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "bb486751acc243c7ba40ad2320584cc7": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "c18aa1f45a5d438b81eff9b7dc74dc3f": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_cdbafac1f2c443b19d7ab2c9ca38d4b5",
            "placeholder": "​",
            "style": "IPY_MODEL_d2ad42bf5f36400598d5799c1982f25f",
            "value": "Downloading pytorch_model.bin: 100%"
          }
        },
        "c56fc413775d4b00998d0ec9b62908b7": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "cd7ce361cbab4ca9a26219bb4c63c2e7": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_c18aa1f45a5d438b81eff9b7dc74dc3f",
              "IPY_MODEL_9846163a45a841fb838c38e7940cf08a",
              "IPY_MODEL_444d9d6a966a4221ae45196add0c56ed"
            ],
            "layout": "IPY_MODEL_3bac58b93e2b4791b5e65828cc2f4e87"
          }
        },
        "cdbafac1f2c443b19d7ab2c9ca38d4b5": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d08170e5b9c64021868a9cb533a2135f": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_28a5430a256b40b3bc788c3b7f58e043",
            "placeholder": "​",
            "style": "IPY_MODEL_022be0f8524d46329f4153d42b0a8240",
            "value": " 966/966 [00:00&lt;00:00, 13.3kB/s]"
          }
        },
        "d2385abfdd844158a2dc77dc234addbc": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_e96acf9c7a4f404e8e392bc05cb5e49c",
              "IPY_MODEL_a85b595e42904c438f99e55ab3c26573",
              "IPY_MODEL_672f360395a949058e9b7c0aa76c3d0d"
            ],
            "layout": "IPY_MODEL_596dcf3cdbfa4d71a249c6f373af1c32"
          }
        },
        "d2ad42bf5f36400598d5799c1982f25f": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "DescriptionStyleModel",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "d4cabeb7b8b9456a9ed765bb1050c1ec": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d73ab650cde946eb8dcffcefb5ecb0a9": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d8c141c90b8448c8b94b7fdb05f33e8a": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "da80821d75684999b2015753be2c60ce": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "db10a05f6bab494dade6d506729ba88a": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d8c141c90b8448c8b94b7fdb05f33e8a",
            "placeholder": "​",
            "style": "IPY_MODEL_1df988d008824a1f89d448521d551e40",
            "value": "Downloading (…)solve/main/models.py: 100%"
          }
        },
        "dc2f3c871dc645a998706ae9f07a5047": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HBoxModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_7aedfd15e36c4c64a62f58f77b294c5b",
              "IPY_MODEL_b0c415524e5c4887b829fb52a8430429",
              "IPY_MODEL_8af166135c54459393b59687df5b4f94"
            ],
            "layout": "IPY_MODEL_4fb96d174b9349ebb45a1a4f74ccdbcc"
          }
        },
        "e585312238b24fdb97f6caf44ebb67a9": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_224c592109ab4fbba0f9c4816c0ef2b3",
            "placeholder": "​",
            "style": "IPY_MODEL_7a50891683324cbc86d975064ac4683a",
            "value": "Downloading (…)/main/tokenizer.json: 100%"
          }
        },
        "e5bcd88030744ead8997a504dc4dbcbb": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e96acf9c7a4f404e8e392bc05cb5e49c": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "HTMLModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_08fe8aa88f104578b88be77c9b4eeb78",
            "placeholder": "​",
            "style": "IPY_MODEL_bb486751acc243c7ba40ad2320584cc7",
            "value": "Downloading (…)okenizer_config.json: 100%"
          }
        },
        "e9de4a1b65154c3b9f09f08a81ba73f8": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "eb45bd6dc8cf4263ab43ca0f7a3cb101": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "f83acae5980f46079819475a8e831965": {
          "model_module": "@jupyter-widgets/base",
          "model_module_version": "1.2.0",
          "model_name": "LayoutModel",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "f9e0aac933394be693c36db197e3ee0f": {
          "model_module": "@jupyter-widgets/controls",
          "model_module_version": "1.5.0",
          "model_name": "FloatProgressModel",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_29e87846ae3b4caaacdbe6e6433df5a9",
            "max": 966,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_43eb4039ca3a4646a64ea3ed1afc20bd",
            "value": 966
          }
        }
      }
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
